<script lang="ts" setup>
import {reactive} from "vue";

const newList = reactive([
  {id: '001', name: 'xinwen1'},
  {id: '002', name: 'xinwen2'},
])
</script>

<template>
  <div>
    <ul>
      <li v-for="news in newList" :key="news.id">
        <!--        第一种写法-->
        <!--        <RouterLink :to="`/news/detailsNew?id=${news.id}&name=${news.name}`">{{  news.name }}</RouterLink>-->

        <RouterLink :to="{ path: '/news/detailsNew',query:{
          id: news.id,
          name: news.name
        } }">{{ news.name }}</RouterLink>
      </li>
    </ul>
    <div>内容
      <router-view></router-view>
    </div>
  </div>
</template>

<style scoped>

</style>